// 企业

import request, { singleRequest } from '@/utils/request'

// 开通后台账号
export const createAdmin = async (data = {}) => {
    const res = await singleRequest({
        url: '/company/createAdmin',
        method: 'post',
        data,
    })
    return res
}

// 当前企业信息
export const companyInfo = async (data = {}) => {
    const res = await request({
        url: '/company/currentInfo',
        method: 'post',
        data,
    })
    return res
}

// 当前企业列表
export const companyList = async (data = {}) => {
    const res = await singleRequest({
        url: '/company/listNew',
        method: 'post',
        data,
    })
    return res
}
// 当前企业列表
export const employeeList = async (data = {}) => {
    const res = await singleRequest({
        url: '/employee/list',
        method: 'post',
        data,
    })
    return res
}

// 当前企业列表
export const companyUpdate = async (data = {}) => {
    const res = await request({
        url: '/company/update',
        method: 'post',
        data,
    })
    return res
}

/**设置开关 */
export const setAuth = async (params) => {
    const res = await request({
        url: `/employee/appSwitch`,
        method: 'get',
        params,
    })
    return res
}
/**
 *@Description 数据统计 - 企业信息管理 - 开通应用.
 *@Return .
**/
export const batchApp = async (corpId) => {
    const res = await request({
        url: `/company/batch-enable-app/${corpId}`,
        method: 'get',
    })
    return res
}

/**设置开关 */
export const setCabin = async (params) => {
    const res = await request({
        url: `/employee/modelSetting`,
        method: 'get',
        params,
    })
    return res
}
/**设置开关 */
export const companyRefresh = async (id) => {
    const res = await request({
        url: `/company/batchSyncEmp?compId=${id}`,
        method: 'get',
    })
    return res
}

// 企业设置
export const newCompanyUpdate = async (data = {}) => {
    const res = await request({
        url: '/company/enterpriseSetting',
        method: 'post',
        data,
    })
    return res
}

// 续费列表
export const queryRenewList = async (params = {}) => {
    const res = await request({
        url: '/company/renewLists',
        method: 'get',
        params,
    })
    return res
}
// 续费设置
export const renewSetting = async (data = {}) => {
    const res = await request({
        url: '/company/renewSetting',
        method: 'post',
        data,
    })
    return res
}